package org.example.service.Impl;

import org.example.entity.Student;
import org.example.mapper.StudentMapper;
import org.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper s;


    @Override
    public void insert(Student student) {
        s.insert(student);
    }

    @Override
    public void update(Student student) {
        s.update(student);
    }

    @Override
    public void delete(Integer id) {
        s.delete(id);
    }

    @Override
    public Student getById(Integer id) {
        Student byId = s.getById(id);
        return byId;
    }

    @Override
    public List<Student> getAll() {
        List<Student> all = s.getAll();
        return all;
    }


}
